Skip to content

[INTERNAL] Refactoring #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 2, 2021
Merged

[INTERNAL] Refactoring #182

merged 8 commits into from
Sep 2, 2021

Conversation

matz3
Copy link
Member

@matz3 matz3 commented Aug 31, 2021

JIRA: CPOUI5FOUNDATION-355

@matz3 matz3 requested a review from codeworrior September 1, 2021 14:07
@matz3 matz3 marked this pull request as ready for review September 1, 2021 14:08
Copy link
Member

@codeworrior codeworrior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the refactoring looks good to me.

Not sure if you would like to modernize the code in general. Some methods still use that = this (instead of arrow functions) and could use async (e.g. cacheTheme).

@matz3
Copy link
Member Author

matz3 commented Sep 2, 2021

Not sure if you would like to modernize the code in general. Some methods still use that = this (instead of arrow functions) and could use async (e.g. cacheTheme).

Sorry, I missed to explain that:
The motivation of this refactoring is to extract code from the monolithic index.js script to improve testability of
individual functionalities. But I only focused on parts that are likely to be touched as part of #168 ("Improved CSS Variables support"). This PR is based on refactoring that was already made as part of that PR.

@matz3
Copy link
Member Author

matz3 commented Sep 2, 2021

Using new language features is a good thing but I didn't focus on changing all the code. Can be done as another follow-up, along with fixing the max-len issues.
I only focused on using async/await as it really improves the code structure.

- Convert Promises to async/await
- Use template literals
Reducing the monolithic index.js script to improve testability of
individual functionalities rather then just testing the whole build
based on input/output.
Might be different in older Node.js versions
@matz3
Copy link
Member Author

matz3 commented Sep 2, 2021

Rebased on top of master to also test on Node 16 (see #183)

Copy link
Member

@codeworrior codeworrior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Fixing code styles issues later is totally acceptable, same for modernising.

@matz3
Copy link
Member Author

matz3 commented Sep 2, 2021

Thanks 👍🏻

@matz3
Copy link
Member Author

matz3 commented Sep 2, 2021

Note: I'm using rebase and merge to keep the history and have separate commits for changing the code and moving it to other files.

@matz3 matz3 merged commit caccdf3 into master Sep 2, 2021
@matz3 matz3 deleted the refactoring branch September 2, 2021 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants